Repository navigation
fix(engine): Let a walk leave the Dock it just stepped off - #365
Merged
Merged
Conversation
omesser
force-pushed
the
fix/327-sprite-width-edge-clearance
branch
from
September 5, 2026 16:17
cd8e8fb to
438af99
Compare
omesser
force-pushed
the
fix/361-dock-walk
branch
from
September 5, 2026 16:31
1391502 to
37310c7
Compare
omesser
changed the base branch from
fix/327-sprite-width-edge-clearance
to
main
September 5, 2026 16:32
The Dock's side caught a sprite moving away from it, climbed it back up and put it on the top to step off again. Everything past the Dock was unreachable. Co-authored-by: Cursor <cursoragent@cursor.com>
omesser
force-pushed
the
fix/361-dock-walk
branch
from
September 5, 2026 16:39
37310c7 to
b2c19c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A Character can never get past the Dock. It climbs the near side, walks the
top, steps off the far end — and is caught by the side it just cleared, climbed
back up, and put back on the top to do it again. Everything beyond the Dock,
including the screen edge it was heading for, is unreachable for as long as the
app runs.
The Engine alone, Dock at x 400..600 on a 1000-wide display, held walk heading
left. Frame 73 is frame 0 again:
Reported against BMO, which "hits the left display wall while still on the
dock, so it can't walk left, and never reaches the edge to climb up". The wall
is not the display's — it is the Dock's own side, a half-sprite out and nowhere
near the screen edge, which is why it looks like it bounces off nothing.
What changed
dock_side_reachedlearns which way the sprite is going. The Dock's side is awall for one moving into it and not for one moving away — the rule
wall_reachedalready keeps for a display edge, and states in its own doccomment: "only while the sprite is moving into it. Every inner edge is
somewhere to cross rather than something to catch." The Dock's side never got
it.
Strictly behind the Dock there is no reprieve, whichever way the sprite is
travelling: a real Dock is wide and the way out from under one is a long way
sideways, all of it unseen, which is what #176 decided. So the margin outside
the Dock's span is directional and the span itself is not.
The "behind" test is strict, so a sprite level with the Dock's own edge counts
as being in the margin and may leave. That is the position stepping off the top
lands on, and treating it as behind would keep the trap shut.
The accepted cost: a sprite coming to rest in the margin while moving away —
not walking, not thrown, just stopping there — stands overlapping the Dock's
edge by up to a half-sprite rather than being pushed clear. It takes a throw
that runs out of speed inside a band a half-sprite wide. That belongs to the
resting inset if it ever shows up, not to a wall in the middle of the floor.
How to verify
cargo test --workspace— 417, 212 and 18 pass.cargo clippy --workspace --all-targets -D warningsandcargo fmt --checkare clean.a_walk_off_the_dock_top_carries_on_past_it_rather_than_climbing_backholds awalk off the Dock's top and asserts it reaches the display edge without ever
being put back on the Dock. Without the fix it fails at the fourth frame with
put back on the Dock it had just walked off: position (464, 700), Perched—the loop itself.
The three tests pinning the behaviour this must not break all still pass
untouched:
a_walk_into_the_dock_climbs_onto_it_rather_than_behind_it(#176),a_sprite_dropped_behind_the_dock_climbs_out_onto_it, anda_sprite_dropped_near_the_docks_right_end_climbs_out_that_side.Traced end to end, the Character now patrols the whole display: off the Dock,
left to the screen edge at 0, climbs it, back across, climbs onto the Dock
when it walks into the side, off its right end, out to the right edge at 1000,
and back.
Notes
This bug is not #328's, though it was found while testing it. The same loop
runs on
mainwith the fixedEDGE_CLEARANCEof 64 — leftmost point 336,against 337 with #328's per-Character clearance. One point apart.
#328 and this both touch
dock_side_reached, so whichever lands second needs atrivial rebase: #328 adds a
clearanceparameter, this one addsvelocity_x.Independent otherwise, and both are based on
main.Closes #361
— Cursor agent, on @omesser's behalf.